<!DOCTYPE html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Captive</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>


<script>

	var init = 5;
	
	$(document).ready(
		function() {
			document.getElementById("dialog").style.display="inherit";
			document.getElementById("background").style.display="inherit";
			document.getElementById("dialog").innerHTML = "(At Ferst Harbor. No one is around.)";
			$("#dialog").click(dialog1);
		}
	);
	
	function dialog1()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I shout: <br/>I'm here!! I have the money!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2);
		}
	}
	
	function dialog2()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Silence)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_1);
		}
	}
	
	function dialog2_1()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "Where are Jimmy and the kidnapper? I think I'm at the right place...Ferst Harbor...";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_2);
		}
	}
	
	function dialog2_2()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I shout: <br/>Where are you, Jimmy?";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_3);
		}
	}
	
	function dialog2_3()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(I am knocked out by someone.)";
		document.getElementById('audiotag1').play();
		document.getElementById("background").style.display="none";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog7);
		}
	}
	
	function dialog7()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene1);
	}
	
	function nextscene1()
	{
			window.location = "scene2-2-1.php";
	}
	
	
</script>



</head>

<body>


<div id="container">
	<div id="background"><img src="images/harbor.jpg" /></div>
	<div id="dialog">
	</div>
</div>

<audio id="audiotag1" src="audios/hit.mp3" preload="auto"></audio>



</body>
</html>